package com.huangmb.anymark.app.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.huangmb.anymark.app.R;
import com.huangmb.anymark.app.model.UserMarker;

import java.util.List;

/**
 * 用户自己标记的POI列表的适配器
 * @author hmb
 * @version 1.0
 * @since 2016/4/20 0:03
 */
public class SelfPoiListAdapter extends RecyclerView.Adapter<SelfPoiListAdapter.ViewHolder> {
    private final List<UserMarker> mUserMarkerList;
    private final LayoutInflater inflater;

    public SelfPoiListAdapter(Context context, List<UserMarker> list) {
        inflater = LayoutInflater.from(context);
        mUserMarkerList = list;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = inflater.inflate(R.layout.self_poi_list_item, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);

        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.setUpView(mUserMarkerList.get(position));
    }

    @Override
    public int getItemCount() {
        return mUserMarkerList == null ? 0 : mUserMarkerList.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        public ViewHolder(View itemView) {
            super(itemView);
        }

        public void setUpView(UserMarker item) {

        }
    }
}
